package com.dinim.physics2D;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;

import com.dinim.object.IObject2D;

public class sdlf {

    //private HashMap objectGroupHashcodes = new HashMap();
    private List objectGroups = new ArrayList();
    
    public void addObjectGroup(IObject2D object1, IObject2D object2){
        
//        int hc1 = object1.hashCode();
//        int hc2 = object2.hashCode();
//        String value;
//        if (hc1<hc2) {
//            value = hc1 + ";" + hc2;
//            objectGroups.add(new IObject2D[]{object1, object2});
//        } else {
//            value = hc2 + ";" + hc1;
//            objectGroups.add(new IObject2D[]{object2, object1});
//        }
//        objectGroupHashcodes.put(object1, value);
//        objectGroupHashcodes.put(object2, value);
//        ObjectGroup og = new ObjectGroup()
//        if()
    }
    
//    private class ObjectOnMap{
//        private IObject2D object;
//        private 
//    }
    /**
     * Compares its two arguments for order.  Returns a negative integer,
    * zero, or a positive integer as the first argument is less than, equal
    * to, or greater than the second.<p>
     */
    
    
    public void testsetset(){
        List l = new ArrayList();
        Comparator c = new Comparator(){

            public int compare(Object o1, Object o2) {
                IObject2D obj1 = (IObject2D)o1;
                IObject2D obj2 = (IObject2D)o2;
                double top1 = obj1.getBoundingBox().getTop();
                double top2 = obj2.getBoundingBox().getTop();
                return (int)Math.round(top1 - top2);
            }
            
        };
        
        Collections.sort(l, c);
    }
    
    public Collection getObjectGroupList(){
        //return objectGroupHashcodes.values();
        return null;
    }
    
    public void print(){
        //Iterator it = objectGroupHashcodes.values().iterator();
        
    }
    
}
